package com.dragonsky.shop.user.service.impl;

import com.dragonsky.shop.common.utils.AjaxResult;
import com.dragonsky.shop.openfeign.user.param.UserInfoParam;
import com.dragonsky.shop.openfeign.user.vo.UserInfoVo;
import com.dragonsky.shop.user.service.UserFeignService;
import org.springframework.stereotype.Service;

@Service
public class UserFeignServiceImpl implements UserFeignService {

    @Override
    public AjaxResult<String> userName(String userName) {
        return AjaxResult.succeed("你的名字是：" + userName);
    }

    @Override
    public AjaxResult<UserInfoVo> userInfo(UserInfoParam userInfoParam) {
        return AjaxResult.succeedWith(UserInfoVo
            .builder()
            .userName(userInfoParam.getUserName())
            .userId(userInfoParam.getUserId())
            .age(12)
            .build()
        );
    }

    @Override
    public AjaxResult<UserInfoVo> userInfo2(UserInfoParam userInfoParam) {
        return AjaxResult.succeedWith(UserInfoVo
            .builder()
            .userName(userInfoParam.getUserName())
            .userId(userInfoParam.getUserId())
            .age(13)
            .build()
        );
    }

    @Override
    public AjaxResult<UserInfoVo> userInfo3(UserInfoParam userInfoParam) {
        return AjaxResult.succeedWith(UserInfoVo
            .builder()
            .userName(userInfoParam.getUserName())
            .userId(userInfoParam.getUserId())
            .age(14)
            .build()
        );
    }

}
